import Vue from "vue";
import VueRouter from "vue-router";
import searchRouter from "./modules/searchRouter";
import recommendRouter from "./modules/recommendRouter";
import PlaymusicB from "../views/recommend/music/index.vue";
import hotRouters from "./modules/hotRouters";
import Login from "../views/login/login.vue";
import Musiclist from "./modules/musiclist"
import Musicinfo from "../views/search/musicinfo.vue"
import Playmusic from "../views/search/playmusic.vue"
import Wode from '../views/login/wode/index.vue'
import hotinfoRouter from '../views/hot/hotinfo/index.vue'
import hotloginRouter from '../views/hot/hotlogin/index.vue'

import comment from "./modules/comment";
import Recomedlist from "../views/recommend/recomedlist/index.vue";

Vue.use(VueRouter)

const routes = [
  // 评论
  ...comment,
  {
    path: "",
    redirect: "/recommend",
  },
  // 单页面
  {
    path: '/login',
    component: Login,
    meta: {
      isShow: false
    }
  },
  {
    path: '/login/wode',
    component: Wode,
    meta: {
      isShow: false
    }
  },
  {
    path: "/musicinfo",
    component: Musicinfo,
    meta: {
      isShow: false
    }
  },
  {
    path: "/playmusic",
    component: Playmusic,
    meta: {
      isShow: false
    }
  },
  {
    path: "/hotlogin",
    component: hotloginRouter
  },
  {
    path: "/hotinfo",
    name: "/hotinfo",
    component: hotinfoRouter,
    props: true
  },
  {
    path: '/playmusicB/:id',
    component: PlaymusicB,
    props: true,
    meta: {
      isShow: false
    }
  },
  {
    path: '/recomedlist/:id',
    component: Recomedlist,
    props: true,
    meta: {
      isShow: false
    }
  },
  {
    path: '/home',
    name: 'home',
    redirect: '/recommend',
    component: () => import('../views/Home.vue'),
    // 所有子组件
    children: [...recommendRouter, ...searchRouter, ...hotRouters, ...Musiclist]
  }
]
const router = new VueRouter({
  routes
});

export default router;

// 除了组件其他同学不要修改这个文件
